package Java.j1;

import java.util.Scanner;

public class AcWing_611 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        Double c = sc.nextDouble();

        int d = sc.nextInt();
        int e = sc.nextInt();
        Double f = sc.nextDouble();

        System.out.printf("VALOR A PAGAR: R$ %.2f\n",(b*c)+(e*f));
    }
}
